/**
*   @file   Node.h
*   @date   2011/08/31
*   @author Sang-soo kim
*   @brief  형태소분석할 때 각 단어의 POS 빈도를 저장하는 structure
*/

#if !defined(__NODE_ARRAY_H__)
#define __NODE_ARRAY_H__
#pragma once
#include <vector>
#include <iostream>
#include <string>
#include "dastrie.h"
#include "Node.h"

class Node_array : public std::vector< Node >
{
public:
    friend dastrie::itail& operator>>(dastrie::itail& is, Node_array& obj)
    {
        obj.clear();
        uint32_t n;
        is >> n;

        std::cout << "in >> :"<< (int) n  << "\n";


        for (uint32_t i = 0;i < n;++i) 
        {
            //std::string dst;
            Node dst;
            is >>dst ;
            obj.push_back( dst );
        }

        return is;
    }
    friend dastrie::otail& operator<<(dastrie::otail& os, const Node_array& obj)
    {
        os << (uint32_t)obj.size();
        for (size_t i = 0;i < obj.size();++i) 
        {
            os << obj[i];
        }
        return os;

    }
};

#endif

